<template>
  <div class="login-container">
    <!-- 动态背景 -->
    <div class="background-animation">
      <div class="floating-shapes">
        <div class="shape shape-1"></div>
        <div class="shape shape-2"></div>
        <div class="shape shape-3"></div>
        <div class="shape shape-4"></div>
        <div class="shape shape-5"></div>
      </div>
    </div>

    <!-- 主要内容 -->
    <div class="login-main">
      <!-- 左侧内容区域 -->
      <div class="login-content">
        <div class="login-card">
          <!-- 头部Logo区域 -->
          <div class="login-header">
            <div class="logo-container">
              <h1 class="brand-name">StarMist</h1>
            </div>
            <p class="brand-desc">专业的博客管理系统</p>
          </div>

          <!-- 登录表单 -->
          <div class="form-container">
            <LoginForm />
          </div>
        </div>
      </div>

      <!-- 右侧装饰区域 -->
      <div class="login-banner">
        <LoginBanner />
      </div>
    </div>

    <!-- 页脚 -->
    <div class="login-footer">
      <Footer />
    </div>
  </div>
</template>

<script lang="ts" setup>
  import Footer from '@/components/footer/index.vue';
  import LoginForm from './components/login-form.vue';
  import LoginBanner from './components/banner.vue';
</script>

<style lang="less" scoped>
  .login-container {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
      radial-gradient(ellipse at top, #667eea 0%, #764ba2 100%),
      linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    background-size:
      100% 100%,
      100% 100%;
    background-attachment: fixed;
    overflow: hidden;
  }

  // 动态背景动画
  .background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;

    .floating-shapes {
      position: relative;
      width: 100%;
      height: 100%;

      .shape {
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        animation: float 20s infinite ease-in-out;

        &.shape-1 {
          width: 80px;
          height: 80px;
          top: 20%;
          left: 10%;
          animation-delay: 0s;
        }

        &.shape-2 {
          width: 120px;
          height: 120px;
          top: 60%;
          right: 20%;
          animation-delay: -5s;
        }

        &.shape-3 {
          width: 60px;
          height: 60px;
          bottom: 30%;
          left: 15%;
          animation-delay: -10s;
        }

        &.shape-4 {
          width: 100px;
          height: 100px;
          top: 10%;
          right: 30%;
          animation-delay: -15s;
        }

        &.shape-5 {
          width: 140px;
          height: 140px;
          bottom: 10%;
          right: 10%;
          animation-delay: -8s;
        }
      }
    }
  }

  @keyframes float {
    0%,
    100% {
      transform: translateY(0) rotate(0deg);
    }
    33% {
      transform: translateY(-30px) rotate(120deg);
    }
    66% {
      transform: translateY(30px) rotate(240deg);
    }
  }

  // 主要内容区域
  .login-main {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 2;
  }

  // 登录内容卡片
  .login-content {
    flex: 1;
    max-width: 480px;
    margin-right: 60px;

    .login-card {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(20px);
      border-radius: 24px;
      padding: 48px 40px;
      box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.2);
      animation: slideInLeft 0.8s ease-out;
    }
  }

  @keyframes slideInLeft {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  // 头部Logo区域
  .login-header {
    text-align: center;
    margin-bottom: 40px;

    .logo-container {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 16px;

      .logo {
        width: 56px;
        height: 56px;
        margin-right: 16px;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
      }

      .brand-name {
        font-size: 32px;
        font-weight: 700;
        margin: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
      }
    }

    .brand-desc {
      font-size: 16px;
      color: rgba(0, 0, 0, 0.6);
      margin: 0;
      font-weight: 500;
    }
  }

  // 右侧装饰区域
  .login-banner {
    flex: 1;
    max-width: 500px;
    animation: slideInRight 0.8s ease-out;
  }

  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  // 页脚
  .login-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;

    :deep(.footer-content) {
      color: rgba(255, 255, 255, 0.8);
      font-size: 14px;
    }
  }

  // 响应式设计
  @media (max-width: 1200px) {
    .login-main {
      flex-direction: column;

      .login-content {
        margin-right: 0;
        margin-bottom: 40px;
      }
    }
  }

  @media (max-width: 768px) {
    .login-container {
      background-attachment: scroll;
    }

    .login-main {
      padding: 20px;

      .login-content .login-card {
        padding: 32px 24px;
        border-radius: 16px;
      }
    }

    .login-banner {
      display: none;
    }

    .background-animation .floating-shapes .shape {
      display: none;
    }
  }

  @media (max-width: 480px) {
    .login-header {
      .logo-container {
        flex-direction: column;

        .logo {
          margin-right: 0;
          margin-bottom: 12px;
        }

        .brand-name {
          font-size: 24px;
        }
      }
    }
  }
</style>

}
